import Axios from '@/utils/request'


//App查询轮播
export function getBannerList(data) {
    return Axios({
        url: '/shop/yaseeShopAdvertisingPicture/page',
        method: 'get',
        params: data,
    })
}

//分页查询商品
export function searchForGoods(data) {
    return Axios({
        url: `/shop/yaseeGoods/searchForGoods`,
        method: 'post',
        data: data,
    })
}

//查询商品列表
export function queryTypeList(data) {
    return Axios({
        url: '/shop/yaseeGoodsType/queryTypeList',
        method: 'get',
        params: data,
    })
}

//查询历史记录搜索
export function searchRecords(data) {
    return Axios({
        url: '/shop/yaseeHistorySearch/searchRecords',
        method: 'get',
        params: data,
    })
}

//删除历史记录
export function deleteSearchRecord(data) {
    return Axios({
        url: '/shop/yaseeHistorySearch/deleteSearchRecord',
        method: 'delete',
    })
}

//商品详情
export function getGoodsDetail(data) {
    return Axios({
        url: `/shop/yaseeGoods/${data.id}`,
        method: 'get',
    })
}

//创建订单
export function createOrder(data) {
    return Axios({
        url: '/shop/yaseeGoodsOrder',
        method: 'post',
        data: data
    })
}

//商品收藏
export function addCollect(data) {
    return Axios({
        url: `/shop/yaseeCollectDetail/addCollect`,
        method: 'get',
        params: data
    })
}

//查询订单接口
export function getOrderList(data) {
    return Axios({
        url: "/shop/yaseeGoodsOrder/appPage",
        method: 'get',
        params: data
    })
}

//查询订单详情接口
export function getOrderDetail(data) {
    return Axios({
        url: `/shop/yaseeGoodsOrder/${data.id}`,
        method: 'get',
    })
}

//删除订单
export function deleteOrderRecord(data) {
    return Axios({
        url: `/shop/yaseeGoodsOrder/${data.id}`,
        method: 'delete',
    })
}

//取消订单
export function canelOrder(data) { //修改
    return Axios({
        url: `/shop/yaseeGoodsOrder/${data.id}`,
        method: 'put',
    })
}

//确定收货接口
export function confirmOrder(data) {
    return Axios({
        url: `shop/yaseeGoodsOrder/confirmReceipt/${data.id}`,
        method: 'get',
    })
}

//计算运费接口
export function freightCalculate(data) {
    return Axios({
        url: `/shop/yaseeShopFreight/freightCalculate`,
        method: 'get',
        params: data
    })
}

//调用支付的接口
export function pay(data) {
    return Axios({
        url: `shop/yaseeGoodsOrder/pay/${data.id} `,
        method: 'get',
    })
}

//修改地址的接口
export function updateOrderAddress(data) {
    return Axios({
        url: `shop/yaseeGoodsOrderDetail/updateOrderAddress`,
        method: 'get',
        params: data
    })
}

//立即支付
export function goodsOrderPay(data) {
    return Axios({
        url: `/shop/yaseeTradeOrder/goodsOrderPay/${data.id}`,
        method: 'get',
    })
}
